package com.zbest.zpay.acctrans.enums.biz;

import java.io.Serializable;

import com.zbest.common.lang.enums.BizCode;
import com.zbest.common.lang.enums.SystemCode;

/**
 * Created by wenfeihu on 16/4/19.
 */
public class AcctransBizCode extends BizCode implements Serializable {
    private static final long serialVersionUID = 910939046271935465L;

    /** 返回码组成3位系统编码+3位编码 */
    /** 1开头的警告级别的错误 */
    /** 2开头的业务级别的错误 */
    /** 8开头的数据库级别的错误 */
    /** 9开头的系统级别的错误 */

    /** 1开头的警告级别的错误 */
    /**
     * 记录不存在
     */
    public static final AcctransBizCode ACT_WARN_NOT_EXIST_RECORD = new AcctransBizCode(
            "ACT_WARN_NOT_EXIST_RECORD", SystemCode.ACCTRANS, "100",
            "记录不存在");

    /**
     * 数据类型转换失败
     */
    public static final AcctransBizCode ACT_DATA_TYPE_SWITCH_ERROR = new AcctransBizCode(
            "ACT_DATA_TYPE_SWITCH_ERROR", SystemCode.ACCTRANS, "101",
            "数据类型转换失败");

    /**
     * 交易码未定义
     */
    public static final AcctransBizCode ACT_TXCD_NOT_DEF = new AcctransBizCode(
            "ACT_TXCD_NOT_DEF", SystemCode.ACCTRANS, "102", "交易码未定义");

    /**
     * 交易功能未开通
     */
    public static final AcctransBizCode ACT_TXCD_CLOSE = new AcctransBizCode(
            "ACT_TXCD_CLOSE", SystemCode.ACCTRANS, "103", "交易功能未开通");

    /**
     * 返回结果为空
     */
    public static final AcctransBizCode ACT_RESULT_CODE_NULL = new AcctransBizCode(
            "ACT_RESULT_CODE_NULL", SystemCode.ACCTRANS, "104", "返回结果为空");

    /**
     * 交易的借贷金额不平
     */
    public static final AcctransBizCode ACT_DEBIT_CREDIT_UNEQUAL = new AcctransBizCode(
            "ACT_DEBIT_CREDIT_UNEQUAL", SystemCode.ACCTRANS, "106",
            "交易的借贷金额不平");

    /** 2开头的业务级别的错误 */
    /**
     * 关键字段不能为空
     */
    public static final AcctransBizCode ACT_FIELD_NOT_NULL = new AcctransBizCode(
            "ACT_FIELD_NOT_NULL", SystemCode.ACCTRANS, "201", "关键字段不能为空");

    /**
     * 账户已存在
     */
    public static final AcctransBizCode ACT_ACCOUNT_IS_EXIST = new AcctransBizCode(
            "ACT_ACCOUNT_IS_EXIST", SystemCode.ACCTRANS, "202", "账户已存在");

    /**
     * 账户类型未定义
     */
    public static final AcctransBizCode ACT_ACT_TYP_NOT_DEF = new AcctransBizCode(
            "ACT_ACT_TYP_NOT_DEF", SystemCode.ACCTRANS, "203", "账户类型未定义");

    /**
     * 主账户余额信息已存在
     */
    public static final AcctransBizCode ACT_ACCOUNT_BALLANCE_IS_EXIST = new AcctransBizCode(
            "ACT_ACCOUNT_BALLANCE_IS_EXIST", SystemCode.ACCTRANS, "204",
            "主账户余额信息已存在");

    /**
     * 主账户信息不存在
     */
    public static final AcctransBizCode ACT_ACCOUNT_NOT_EXIST = new AcctransBizCode(
            "ACT_ACCOUNT_NOT_EXIST", SystemCode.ACCTRANS, "205", "主账户信息不存在");

    /**
     * 主账户信息已注销
     */
    public static final AcctransBizCode ACT_ACCOUNT_CANCEL = new AcctransBizCode(
            "ACT_ACCOUNT_CANCEL", SystemCode.ACCTRANS, "206", "主账户信息已注销");

    /**
     * 主账户信息被冻结
     */
    public static final AcctransBizCode ACT_ACCOUNT_HOLD = new AcctransBizCode(
            "ACT_ACCOUNT_HOLD", SystemCode.ACCTRANS, "207", "主账户信息被冻结");

    /**
     * 创建主账户余额信息失败
     */
    public static final AcctransBizCode ACT_ACCOUNT_CRTBAL_FAIL = new AcctransBizCode(
            "ACT_ACCOUNT_CRTBAL_FAIL", SystemCode.ACCTRANS, "208",
            "创建主账户余额信息失败");

    /**
     * 账户余额金额值非法
     */
    public static final AcctransBizCode ACT_ACCOUNT_CURBAL_ILLEGAL = new AcctransBizCode(
            "ACT_ACCOUNT_CURBAL_ILLEGAL", SystemCode.ACCTRANS, "209",
            "账户余额金额值非法");

    /**
     * 交易金额非法
     */
    public static final AcctransBizCode ACT_ACCOUNT_TXAMT_ILLEGAL = new AcctransBizCode(
            "ACT_ACCOUNT_TXAMT_ILLEGAL", SystemCode.ACCTRANS, "210",
            "交易金额非法");

    /**
     * 更新主账户余额失败
     */
    public static final AcctransBizCode ACT_ACCOUNT_UPDBAL_FAIL = new AcctransBizCode(
            "ACT_ACCOUNT_UPDBAL_FAIL", SystemCode.ACCTRANS, "211",
            "更新主账户余额失败");

    /**
     * 是否更新余额标志非法
     */
    public static final AcctransBizCode ACT_ACCOUNT_UPDBAL_FLAG = new AcctransBizCode(
            "ACT_ACCOUNT_UPDBAL_FLAG", SystemCode.ACCTRANS, "212",
            "是否更新余额标志非法");

    /**
     * 创建内部账户余额信息失败
     */
    public static final AcctransBizCode ACT_INNER_ACCOUNT_CRTBAL_FAIL = new AcctransBizCode(
            "ACT_INNER_ACCOUNT_CRTBAL_FAIL", SystemCode.ACCTRANS, "213",
            "创建内部账户余额信息失败");

    /**
     * 内部账户余额不足
     */
    public static final AcctransBizCode ACT_INNER_ACCOUNT_BAL_NOMUCH = new AcctransBizCode(
            "ACT_INNER_ACCOUNT_BAL_NOMUCH", SystemCode.ACCTRANS, "214",
            "内部账户余额不足");

    /**
     * 更新内部账户余额失败
     */
    public static final AcctransBizCode ACT_INNER_ACCOUNT_UPDBAL_FAIL = new AcctransBizCode(
            "ACT_INNER_ACCOUNT_UPDBAL_FAIL", SystemCode.ACCTRANS, "215",
            "更新内部账户余额失败");

    /**
     * 主账户余额信息不存在
     */
    public static final AcctransBizCode ACT_ACCOUNT_BAL_NOT_EXIST = new AcctransBizCode(
            "ACT_ACCOUNT_BAL_NOT_EXIST", SystemCode.ACCTRANS, "216",
            "主账户余额信息不存在");

    /**
     * 主账户余额不足
     */
    public static final AcctransBizCode ACT_ACCOUNT_BAL_NOMUCH = new AcctransBizCode(
            "ACT_ACCOUNT_BAL_NOMUCH", SystemCode.ACCTRANS, "217", "主账户余额不足");

    /**
     * 同冻结编号下追加的冻结账户必须一致
     */
    public static final AcctransBizCode ACT_ACCOUNT_HOLD_ACCOUNTDIFF = new AcctransBizCode(
            "ACT_ACCOUNT_HOLD_ACCOUNTDIFF", SystemCode.ACCTRANS, "218",
            "同冻结编号下追加的冻结账户必须一致");

    /**
     * 不存在该冻结编号信息
     */
    public static final AcctransBizCode ACT_ACCOUNT_NOT_EXIST_HOLD = new AcctransBizCode(
            "ACT_ACCOUNT_NOT_EXIST_HOLD", SystemCode.ACCTRANS, "219",
            "不存在该冻结编号信息");

    /**
     * 解冻金额大于原始冻结金额
     */
    public static final AcctransBizCode ACT_ACCOUNT_UNHOLDAMT_FAIL = new AcctransBizCode(
            "ACT_ACCOUNT_UNHOLDAMT_FAIL", SystemCode.ACCTRANS, "220",
            "解冻金额大于原始冻结金额");

    /**
     * 内部账户信息不存在
     */
    public static final AcctransBizCode ACT_INNER_ACCOUNT_NOT_EXIST = new AcctransBizCode(
            "ACT_INNER_ACCOUNT_NOT_EXIST", SystemCode.ACCTRANS, "221",
            "内部账户信息不存在");

    /**
     * 借贷标志非法
     */
    public static final AcctransBizCode ACT_DCFLAG_ILLEGAL = new AcctransBizCode(
            "ACT_DCFLAG_ILLEGAL", SystemCode.ACCTRANS, "222", "借贷标志非法");

    /**
     * 冻结编号不存在
     */
    public static final AcctransBizCode ACT_ACCOUNT_HOLDNO_NOT_EXIST = new AcctransBizCode(
            "ACT_ACCOUNT_HOLDNO_NOT_EXIST", SystemCode.ACCTRANS, "223",
            "冻结编号不存在");

    public static final AcctransBizCode ACT_ACCOUNT_MAP_NOT_EXIST = new AcctransBizCode(
            "ACT_ACCOUNT_MAP_NOT_EXIST", SystemCode.ACCTRANS, "224",
            "会计分录不存在");

    /**
     * 主账户系统占用余额非法
     */
    public static final AcctransBizCode ACT_REG_INNER_DTL_FAIL = new AcctransBizCode(
            "ACT_REG_INNER_DTL_FAIL", SystemCode.ACCTRANS, "225", "登记内部账户收支明细失败");

    /**
     * 交易流水不存在
     */
    public static final AcctransBizCode ACT_TRANS_JNL_NOT_EXIST = new AcctransBizCode(
            "ACT_TRANS_JNL_NOT_EXIST", SystemCode.ACCTRANS, "226", "交易流水不存在");

    /**
     * 调用会计核算系统失败
     */
    public static final AcctransBizCode ACT_CALL_ACCOUNTING_FAIL = new AcctransBizCode(
            "ACT_CALL_ACCOUNTING_FAIL", SystemCode.ACCTRANS, "228", "调用会计核算系统失败");

    /**
     * 获取会计日期失败
     */
    public static final AcctransBizCode ACT_GET_ACTDAT_FAIL = new AcctransBizCode(
            "ACT_GET_ACTDAT_FAIL", SystemCode.ACCTRANS, "229", "获取会计日期失败");

    /**
     * 登记主账户收支明细信息失败
     */
    public static final AcctransBizCode ACT_REG_MAIN_DTL_FAIL = new AcctransBizCode(
            "ACT_REG_MAIN_DTL_FAIL", SystemCode.ACCTRANS, "230", "登记主账户收支明细信息失败");

    /**
     * 更新综合记账流水表失败
     */
    public static final AcctransBizCode ACT_ACC_JNL_UPD_FAIL = new AcctransBizCode(
            "ACT_ACC_JNL_UPD_FAIL", SystemCode.ACCTRANS, "232", "更新综合记账流水表失败");

    /**
     * 更新记账流水表失败
     */
    public static final AcctransBizCode ACT_TRANS_JNL_UPD_FAIL = new AcctransBizCode(
            "ACT_TRANS_JNL_UPD_FAIL", SystemCode.ACCTRANS, "233", "更新记账流水表失败");


    /** 8开头的数据库级别的错误 */
    /**
     * db幂等异常
     */
    public static final AcctransBizCode DB_SYSTEM_ERROR = new AcctransBizCode(
            "DB_SYSTEM_ERROR", SystemCode.ACCTRANS, "899", "db幂等异常");

    /** 9开头的系统级别的错误 */
    /**
     * 类转换失败
     */
    public static final AcctransBizCode SYSTEM_CLASS_CONVERT_ERROR = new AcctransBizCode(
            "SYSTEM_CLASS_CONVERT_ERROR", SystemCode.ACCTRANS, "901",
            "类转换失败");

    /**
     * 未知错误
     */
    public static final AcctransBizCode UN_KNOWN = new AcctransBizCode(
            "UN_KNOWN", SystemCode.ACCTRANS, "998", "未知错误");

    /**
     * 系统异常
     */
    public static final AcctransBizCode SYSTEM_ERROR = new AcctransBizCode(
            "SYSTEM_ERROR", SystemCode.ACCTRANS, "999", "系统异常");

    private AcctransBizCode(String name, SystemCode serviceCode, String code,
                            String desc) {
        super(name, serviceCode, code, desc);
    }

    private AcctransBizCode() {

    }

}
